<?php 
class BrandModel extends Model{
	public $table="brand";
	public $validate=array(
//	  array("bname","nonull","品牌名称不能为空",2,1),
	
	);
	
	/**
	 * 添加
	 */
	public function addbrand(){
		if(!$this->create()) return false;
		$this->add();
		return true;
	}
	/**
	 * 修改
	 */
	public function editbrand(){
		if(!$this->create()) return false;
		$this->update();
		return true;
		
	}
	/**
	 * 排序
	 */
	 public function brandsort(){
	 	if(!$this->create()) return false;
		
		foreach ($_POST as $k => $v) {
		   $this->data=array(
			     "bid"=>$k,
				 "sort"=>$v
			);
			$this->update();		
		}		
		return true;
	 }
	
}



 ?>